<template>
	<view class="content_view">
		<u-navbar title-color="#FFFFFF" height="48" back-icon-color="#FFFFFF" :border-bottom="false" :is-fixed="true" :title="'一键报警'"></u-navbar>
		<view  class="view-center">
			<view style="font-size: 34rpx;text-align: left;">
				<view style="color: red;">
					误报火警<br/>将承担法律责任
				</view>
			</view>
			<view style="margin-top: 40rpx;">
				<u-button type="error" @click="uploadFire">确认报警</u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			fireAlarm(){
				let userInfo = this.$store.getters.userInfo
				window.native.fireAlarm({channelId:userInfo.ucId,disPlayName:userInfo.userName})
			},
			uploadFire(){
				window.native.getLocation(res => {
					this.utils.request("/api/admin/user/reportUserLocation", {
						location: res.data.addr,
						longitude: res.data.longitude,
						latitude: res.data.latitude
					}, "post", "app", true).then(res => {
						console.log(res)
					}).catch(error => {
						console.log(error)
					})
				})
				let userInfo = this.$store.getters.userInfo
				window.native.uploadFire({reportPerson:userInfo.ucId,type:0})
			}
		}
	}
</script>

<style>

</style>
